package com.fafi.spring.aop.selfadvice;

import org.springframework.aop.AfterAdvice;
import org.springframework.aop.AfterReturningAdvice;
import org.springframework.aop.MethodBeforeAdvice;

import java.lang.reflect.Method;

public class TimerHandler implements MethodBeforeAdvice, AfterReturningAdvice {
	@Override
	public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {
		System.out.println("afterReturning:========");
		System.out.println("returnValue:"+returnValue);
		System.out.println("method:"+method);
		System.out.println("args:"+args);
		System.out.println("target:"+target);
	}

	@Override
	public void before(Method method, Object[] args, Object target) throws Throwable {
		System.out.println("before:========");
		System.out.println("method:"+method);
		System.out.println("args:"+args);
		System.out.println("target:"+target);
	}
}
